﻿using System;
using System.Collections.Generic;
using System.Text;

namespace daSyntaxAnalyser.SyntaxTree
{
    using daBase.Objects;

    public class GotoStatementElement : StatementElement
    {
        private IdElement label;

        public IdElement Label { get { return label; } set { label = value; } }

        public GotoStatementElement(TokenInfo StartInfo, IdElement Label, List<TokenInfo> Comments)
            : base(StartInfo, Comments)
        {
            label = Label;
        }

        public override string ToString()
        {
            return string.Format("goto {0}", label);
        }

        protected override IEnumerator<ISyntaxTreeElement> CreateEnumerator()
        {
            yield return label;
        }
    }
}
